package edu.hgnc.adapter;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public class SimpleHandlerAdapter implements HandlerAdapter {

	private static final Log logger = LogFactory.getLog(SimpleHandlerAdapter.class);

	/**
	 * @param handler 实际传过来的处理handler
	 * @param <T> 传入类型
	 * @throws Exception
	 */
	@Override
	public <T> void handle(T handler){
		logger.debug("handle()");
		((SimpleController) handler).doSimpleHandler();
	}

	/**
	 *
	 * @param handler 实际传过来的处理handler
	 * @return handle是否可以处理？
	 * @param <T> 传入类型
	 */
	@Override
	public <T> boolean supports(T handler){

		boolean isTrue = handler instanceof SimpleController;
		logger.debug("support ? "+isTrue);
		return isTrue;
	}
}
